import React, { useEffect } from 'react'
import { Col, Row, Card } from 'antd';
import { withRouter } from 'react-router-dom/cjs/react-router-dom.min';

function IndustryApp(props) {
  const { Meta } = Card;
  const list2 = [
    {
      id: 4,
      key: "/attendance-manage/all",
      title: "考勤统计",
      description: "学生考勤信息统计分析",
      imgUrl: "images/devicemanage.png"
    },
    {
      id: 5,
      key: "/data-manage",
      title: "预警分析",
      description: "分析学生行为，预警各种违规",
      imgUrl: "images/chart.png"
    }]
  const cardClick = (type) => {
    if (type === "device") {
      props.history.push("/app/devmanage")
    } else if (type === "product") {
      props.history.push("/app/promanage")
    } else {
      props.history.push("/app/opemanage")
    }
  }

  return (
    <div style={{ background: "white", minHeight: document.documentElement.clientHeight - 30, }}>

      <div style={{ padding: "80px 10px" }}>
        <Row justify="space-evenly">
          <Col span={8}>
            <Card
              hoverable
              onClick={() => { cardClick("device") }}
              style={{
                width: "100%",
                padding: "0 10%"
              }}
              cover={<div style={{ textAlign: "center", padding: "10px 0 0 0" }}><img style={{ width: "132px", height: "134px" }} alt="example" src={"images/devicemanage.png"} /></div>}
            >
              <Meta title="设备管理" description="完成设备健康管理工作" />
            </Card>
          </Col>
          <Col span={8}>
            <Card
              hoverable
              style={{
                width: "100%",
                padding: "0 10%"
              }}
              onClick={() => { cardClick("product") }}
              cover={<div style={{ textAlign: "center", padding: "10px 0 0 0" }}><img style={{ width: "132px", height: "134px" }} alt="example" src={"images/promanage.png"} /></div>}
            >
              <Meta title="生产管理" description="完成生产监控分析、质量管理等工作" />
            </Card>
          </Col>
          <Col span={8}>
            <Card
              hoverable
              style={{
                width: "100%",
                padding: "0 10%"
              }}
              onClick={() => { cardClick("operate") }}
              cover={<div style={{ textAlign: "center", padding: "10px 0 0 0" }}><img style={{ width: "132px", height: "134px" }} alt="example" src={"images/opmanage.png"} /></div>}
            >
              <Meta title="运营管理" description="完成订单管理、供应链管理等工作" />
            </Card>
          </Col>
        </Row>
      </div>

    </div>
  )
}
export default withRouter(IndustryApp)